package com.itlong.cloud.POJO.PO;

import com.itlong.cloud.annotation.ItlField;
import com.itlong.cloud.annotation.ItlTables;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;


/**
 * <desc>
 *      门禁设备信息表。
 * </desc>
 *
 * @createDate 2017/09/20
 */
@ItlTables("device_entrance_info")
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper=true)
public class DeviceEntranceInfoPO extends BasePO implements Serializable {

    /**
     * 设备全局唯一序列号(项目编号[8位] + 设备类型[1位] + 设备ID[4位])
     */
    @ItlField(value = "device_unique", logicKey = "key", notNull = "false")
    private String deviceUnique;

    @ItlField("device_id")
    private String deviceId;        //设备ID，即设备机号，与设备硬件拨码对应。

    @ItlField("device_name")
    private String deviceName;      //设备名称，一般由客户自定义。

    @ItlField("project_id")
    private String projectId;       //项目编号，由8位数字构成,00000001~99999999.

    @ItlField("device_memo")
    private String deviceMemo;      //设备说明

    @ItlField("is_face_recognition")
    private Integer isFaceRecognition;      //是否支持人脸识别 0代表否 1代表是

    @ItlField("is_collect_fees")
    private Integer isCollectFees;          //是否收费 0代表否 1代表是

    @ItlField("entrance_type")
    private Integer entranceType;          //门禁类别 1楼栋门禁2单元门禁 3普通门禁

    @ItlField("sn")
    private String sn;                     //sn 按腾讯要求自定义	项目编号 (8) + 预留域（5位，默认为“00000”） + 设备id (3) 的16位字符串

    @ItlField("version")
    private String version;                     //固件版本

    @ItlField("screen")
    private Integer screen;                     //是否带屏幕 0否 1是

    @ItlField("entrance_category")
    private Integer entranceCategory;           //门禁类型 21-蓝牙门禁 22-云门禁

    @ItlField("open_threshold")
    private String openThreshold;           //蓝牙开门阈值

    @ItlField("bind_device_group")
    private String bindDeviceGroup;         //控制器控制门禁设备的标识 即同一控制器所控制的设备该字段为第一个设备的sn

    @ItlField("batch_number")
    private String batchNumber;             //批次号

    //阿里IoT设备相关参数
    @ItlField("product_type_id")
    private String productTypeId; //产品型号ID,云电梯产品型号ID
    @ItlField("iot_device_name")
    private String iotDeviceName;       //IOT设备名称
    @ItlField("iot_device_id")
    private String iotDeviceId;   //阿里云颁发的设备id，全局唯一
    @ItlField("iot_device_secret")
    private String iotDeviceSecret; //设备私钥
    @ItlField("iot_device_status")
    private String iotDeviceStatus; //设备状态，目前预留
    @ItlField("iot_device_work_status")
    private  String iotDeviceWorkStatus; //设备工作状态,ONLINE, OFFLINE, UNACTIVE
    @ItlField("equip_mode")
    private Integer equipMode;              // 设备模式，1普通，2收费
    @ItlField("iot_product_id")
    private String iotProductId;              // 设备产品关系表逻辑主键
    @ItlField(value = "elevator_device_unique",notNull = "false")
    private String elevatorDeviceUnique;        //绑定电梯设备序列号
    @ItlField(value = "elevator_floor",notNull = "false")
    private Integer elevatorFloor;              //电梯楼层
    public DeviceEntranceInfoPO(String deviceUnique) {
        this.deviceUnique = deviceUnique;
    }

    public DeviceEntranceInfoPO(String deviceUnique, String deviceId, String deviceName, String projectId) {
        this.deviceUnique = deviceUnique;
        this.deviceId = deviceId;
        this.deviceName = deviceName;
        this.projectId = projectId;
    }
}